<template>
	<view class="wrap">
		<uni-header title="充值">
			<template #right>
				<view class="right" @click="record">
					<image src="../../static/money.png" mode=""></image>
					<text>充值记录</text>
				</view>
			</template>

		</uni-header>
		<view class="form-item">
			<text class="label">充值币种</text>
			<text class="value">USDT</text>
		</view>
		<view class="form-item">
			<text class="label">充币网络</text>
			<text class="value">TRC20</text>
		</view>
		<view class="form-item">
			<text class="label">充值金额</text>
			<input type="number" v-model="amount" placeholder="请输入提币金额" placeholder-class="phod">
		</view>
		<button class="submit" @click="submit">提交</button>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';
	import {
		walletPw
	} from '@/util/api.js'
	const amount = ref()
	const record = ()=>{
		uni.navigateTo({
			url:"/pages/rechargeRecord/rechargeRecord"
		})
	}
	const submit=()=>{
		if(amount.value<=0){
			uni.showToast({
				icon:"none",
				title:"输入正确金额"
			})
			return false
		}
		walletPw({
			amount:amount.value,
			type:1
		}).then(res=>{
			
			window.location.href = res.data.url
		})
	}
</script>

<style lang="scss" scoped>
	.wrap{
		// position: relative;
		// height: 100vh;
	}
	.form-item{
		width: 690rpx;
		margin: 0 auto;
		height: 120rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		border-bottom: 1rpx solid #f7f7f7;
		.label{
			color: #999;
			font-size: 32rpx;
		}
		.value{
			color: #333;
			font-size: 32rpx;
			font-weight: 600;
		}
		input{
			display: block;
			flex: 2;
			text-align:right;
			color: #333;
			font-size: 32rpx;
			font-weight: 600;
		}
		.phod{
			font-weight: normal;
			color: #999;
			font-size: 24rpx;
		}
	}
	.submit {
		width: 686rpx;
		height: 92rpx;
		background: #1E53E7;
		border-radius: 16rpx;
		position: absolute;
		bottom: 68rpx;
		left: 32rpx;
		color: #fff;
		font-size: 32rpx;
		font-weight: 500;
		line-height: 92rpx;
	}


	.right {
		display: flex;
		margin-right: 32rpx;

		image {
			display: block;
			width: 40rpx;
			height: 40rpx;
			margin-right: 10rpx;
		}

		text {

			color: #181D29;
			font-weight: 500;
			font-size: 32rpx;
		}
	}
</style>